-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
45 lines (36 loc) · 1.85 KB
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int c;
String jog1, jog2;
c = sc.nextInt();
while (c > 0) {
jog1 = sc.next();
jog2 = sc.next();
if ((jog1.equals("tesoura") && jog2.equals("papel")) || (jog1.equals("tesoura") && jog2.equals("lagarto"))
||
(jog1.equals("papel") && jog2.equals("pedra")) || (jog1.equals("papel") && jog2.equals("spock")) ||
(jog1.equals("pedra") && jog2.equals("lagarto")) || (jog1.equals("pedra") && jog2.equals("tesoura"))
||
(jog1.equals("lagarto") && jog2.equals("spock")) || (jog1.equals("lagarto") && jog2.equals("papel"))
||
(jog1.equals("spock") && jog2.equals("tesoura")) || (jog1.equals("spock") && jog2.equals("pedra")))
System.out.println("rajesh");
else if ((jog2.equals("tesoura") && jog1.equals("papel"))
|| (jog2.equals("tesoura") && jog1.equals("lagarto")) ||
(jog2.equals("papel") && jog1.equals("pedra")) || (jog2.equals("papel") && jog1.equals("spock")) ||
(jog2.equals("pedra") && jog1.equals("lagarto")) || (jog2.equals("pedra") && jog1.equals("tesoura"))
||
(jog2.equals("lagarto") && jog1.equals("spock")) || (jog2.equals("lagarto") && jog1.equals("papel"))
||
(jog2.equals("spock") && jog1.equals("tesoura")) || (jog2.equals("spock") && jog1.equals("pedra")))
System.out.println("sheldon");
else
System.out.println("empate");
c--;
}
sc.close();
}
}